package com.yq.design.visitor;

import java.util.LinkedList;
import java.util.List;

/**
 * @ClassName ObjectStructure
 * @Description TODO
 * @Author yaoqiang
 * @Date 2021/8/23 17:21
 * @Version 1.0
 */
public class ObjectStructure {
    private List<Person> personList=new LinkedList<>();
    public  void attach(Person person){ personList.add(person); }
    public void display(Visitor visitor){ for (Person p:personList){ p.accept(visitor); } }}
